﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using OpenTK;

namespace MyOpenGame
{
    public class GameUtility
    {
        private readonly List<List<Vector2>> _attackerPoints;
        private readonly List<List<Vector2>> _defenderPoints;
        private readonly List<Vector2> _inventoryPoints;

        public GameUtility()
        {
            _attackerPoints = new List<List<Vector2>>();
            _defenderPoints = new List<List<Vector2>>();
            _inventoryPoints = new List<Vector2>();

            List<Vector2> rowPoints = new List<Vector2>();

            rowPoints.Add(new Vector2(1000, 700));
            rowPoints.Add(new Vector2(1048, 700));
            rowPoints.Add(new Vector2(1048, 650));
            rowPoints.Add(new Vector2(1000, 650));

            _attackerPoints.Add(rowPoints);

            rowPoints = new List<Vector2>();

            rowPoints.Add(new Vector2(1000, 500));
            rowPoints.Add(new Vector2(1048, 500));
            rowPoints.Add(new Vector2(1048, 450));
            rowPoints.Add(new Vector2(1000, 450));

            _attackerPoints.Add(rowPoints);

            rowPoints = new List<Vector2>();

            rowPoints.Add(new Vector2(1000, 300));
            rowPoints.Add(new Vector2(1048, 300));
            rowPoints.Add(new Vector2(1048, 250));
            rowPoints.Add(new Vector2(1000, 250));

            _attackerPoints.Add(rowPoints);

            rowPoints = new List<Vector2>();

            rowPoints.Add(new Vector2(1000, 100));
            rowPoints.Add(new Vector2(1048, 100));
            rowPoints.Add(new Vector2(1048, 50));
            rowPoints.Add(new Vector2(1000, 50));

            _attackerPoints.Add(rowPoints);

            //
            rowPoints = new List<Vector2>();

            rowPoints.Add(new Vector2(50, 700));
            rowPoints.Add(new Vector2(100, 700));
            rowPoints.Add(new Vector2(100, 650));
            rowPoints.Add(new Vector2(50, 650));

            _defenderPoints.Add(rowPoints);

            rowPoints = new List<Vector2>();

            rowPoints.Add(new Vector2(50, 500));
            rowPoints.Add(new Vector2(100, 500));
            rowPoints.Add(new Vector2(100, 450));
            rowPoints.Add(new Vector2(50, 450));

            _defenderPoints.Add(rowPoints);

            rowPoints = new List<Vector2>();

            rowPoints.Add(new Vector2(50, 300));
            rowPoints.Add(new Vector2(100, 300));
            rowPoints.Add(new Vector2(100, 250));
            rowPoints.Add(new Vector2(50, 250));

            _defenderPoints.Add(rowPoints);

            rowPoints = new List<Vector2>();

            rowPoints.Add(new Vector2(50, 100));
            rowPoints.Add(new Vector2(100, 100));
            rowPoints.Add(new Vector2(100, 50));
            rowPoints.Add(new Vector2(50, 50));

            _defenderPoints.Add(rowPoints);

            _inventoryPoints = new List<Vector2>();

            _inventoryPoints.Add(new Vector2(600, 0));
            _inventoryPoints.Add(new Vector2(844, 0));
            _inventoryPoints.Add(new Vector2(844, -91));
            _inventoryPoints.Add(new Vector2(600, -91));
        }

       

        public List<Vector2> GetAttackerPointsForRow(int row)
        {
            if (_attackerPoints[row] == null)
            {

            }

            return _attackerPoints[row];
        }

        public List<Vector2> GetDefenderPointsForRow(int row)
        {
            if (_defenderPoints[row] == null)
            {

            }

            return _defenderPoints[row];
        }

        public int GetDefenderCount()
        {
            return _defenderPoints.Count();
        }

        public List<Vector2> GetInventoryPoints()
        {
            return _inventoryPoints;
        }
    }
}
